<template>
	<div class="agreement">
		<!-- <div class="search">
			<uni-search-bar placeholder="搜索" bgColor="#EEEEEE" @confirm="search" />
		</div> -->
		<div class="ag-list" v-if="protocolArr.length > 0">
			<ul class="list-ag">
				<li v-for="(item, index) in protocolArr" :key="index" @click="getDetail(item.id)">{{ item.protocolName }}</li>
			</ul>
		</div>
		<div class="no-data" v-if="protocolArr.length === 0">
      <img src="https://newmefit.cn/resource/gym/base/base6.png">
    </div>
	</div>
</template>

<script>
import { mapGetters } from 'vuex'
import { protocolEnabledGet } from '@/api/manageApi'
export default {
	data() {
		return {
			protocolArr: []
		}
	},
	computed: {
		...mapGetters(['userInfo', 'uniToken'])
	},
	onLoad() {
		this.getProtocolEnabled()
	},
	methods: {
		search () {},
		getProtocolEnabled () {
			protocolEnabledGet('').then(res => {
				// console.log(res)
				if (res.code == '200') {
					var data = res.data
					this.protocolArr = data
				}
			})
		},
		getDetail (id) {
			var url = '/pagesA/user/agreementDetail?id=' + id
			this.goUrl(url)
		}
	}
}
</script>

<style lang="scss">
.agreement {
	.search{
		background: #fff;
	}
	.ag-list{
		margin-top: 24rpx;
		background: #fff;
		.list-ag{
			li{
				width: 100%;
				height: 100rpx;
				line-height: 100rpx;
				font-size: 30rpx;
				color: #1E1E1E;
				border-bottom: 1px solid #eee;
				padding: 0 60rpx 0 47rpx;
				box-sizing: border-box;
				position: relative;
			}
			li::after{
				content: '';
				width: 10rpx;
				height: 18rpx;
				background: url('../../static/right2.png') no-repeat 0 0;
				background-size: cover;
				position: absolute;
				top: 41rpx;
				right: 40rpx;
			}
		}
	}

}
</style>
